<!DOCTYPE html>
<html>
<head>
	<title>账号注册</title>
	<meta charset='utf-8' />
	<script src='__PUBLIC__/Js/jquery.js'></script>
</head>
<body style='background:#ecc'>
<div style='margin-top:50px'>
	<div style='text-align:center;color:red'>您正在找回密码!</div>
	<form actions='__URL__/register_back_c' method='post' >
		<input type='hidden' name='email' value='{$email}' />
		<div style='margin:0 auto;width:150px;margin-top:30px'>
			<div>请输入新密码： </div>
			<div>
				<input type='password' name = 'register_pwd_set_p' />
			</div>
		</div>
		<div style='margin:0 auto;width:150px;margin-top:10px'>
			<div>请确认新密码： </div>
			<div>
				<input type='password' name = 'register_pwd_set_p2' />
			</div>
		</div>
		<div style='text-align:center;margin-top:20px'>
			<button id='register_pwd_set_sub' type='button'>提交</button>
			<input type='reset' value=' 重置' />
		</div>
	</form>
</div>


<script>
	$('#register_pwd_set_sub').click(function(){
		var register_pwd_set_p = $('input[name=register_pwd_set_p]').val().trim();
		var register_pwd_set_p2 = $('input[name=register_pwd_set_p2]').val().trim();
		if(!register_pwd_set_p || !register_pwd_set_p2){
			alert('密码不得为空！');exit;
		}
		if(register_pwd_set_p != register_pwd_set_p2){
			alert('两次密码不一致！');exit;
		}
		$.ajax({
			url:'__MODULE__/User/pwdfind_back_c_ajax',
			type:'post',
			data:{
				token:'<?php echo Token_Set('pwdfind_back_c_ajax');?>',
				email:'{:session('pwdfind_mail')}',
				pwd:register_pwd_set_p
			},
			success:function(res){
				//alert(res);
				switch(res){
					case 'e1':
						alert('信息添写不完整！');
					break;
					case 'e2':
						alert('出现异常，请重新注册！');
					break;
					case 'e3':
						alert('操作异常!');
					break;
					case 'ok':
						alert('操作成功！');
						switch('{:session('current_module')}'){
							case 'Fang':
								location.href='http://{$_SERVER['HTTP_HOST']}/fang.html';
							break;
							default:
							alert(2);
						}
					break;
					default:
						alert('非法访问！');
				}
			}
			
		});
	});

</script>
</body>
</html>